﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using PersistanceLayer.Entity;

namespace PersistanceLayer
{
    public static class RepositoryFactory
    {
        public static IChatBoxDataRepository CreateNewRepository()
        {
            if (_mockRepository != null)
                return _mockRepository;
          // return new InXmlRepository();
            return new InMemoryRepository();
            return new EntityRepository();
        }
     // For unit tests
        private static IChatBoxDataRepository _mockRepository = null;
        internal static void SetRepository(IChatBoxDataRepository mockRepository)
        {
            _mockRepository = mockRepository;
        }
    }
}
